package com.cndw.kungfu.domain;

import java.util.LinkedHashSet;
import java.util.Set;
import com.cndw.kungfu.ext.StringProcesser;

/**
 *玩家侍从
 */
public class Livery {
	/**
	 * 玩家id
	 */
	private long playerId;
	/**
	 * 0自由身 1老爷 2侍从
	 */
	private int cardId;
	/**
	 * 工作开始时间
	 */
	private int beginTime;
	/**
	 * 工作结束时间
	 */
	private int endTime;
	/**
	 * 逃跑时间
	 */
	private int escapeTime;
	/**
	 * 老爷id
	 */
	private long masterId;
	/**
	 * 侍从ids
	 */
	private String liveries;
	/**
	 * 手下败将
	 */
	private String losers;
	/**
	 * 夺仆之敌
	 */
	private String robEnemies;
	
	private Set<Long> liverySet;
	private Set<Long> loserSet;
	private Set<Long> robEnemySet;

	private int lastRead;
	
	public long getPlayerId() {
		return playerId;
	}
	public void setPlayerId(long playerId) {
		this.playerId = playerId;
	}
	public int getCardId() {
		return cardId;
	}
	public void setCardId(int cardId) {
		this.cardId = cardId;
	}
	public int getBeginTime() {
		return beginTime;
	}
	public void setBeginTime(int beginTime) {
		this.beginTime = beginTime;
	}
	public int getEndTime() {
		return endTime;
	}
	public void setEndTime(int endTime) {
		this.endTime = endTime;
	}
	public int getEscapeTime() {
		return escapeTime;
	}
	public void setEscapeTime(int escapeTime) {
		this.escapeTime = escapeTime;
	}
	public long getMasterId() {
		return masterId;
	}
	public void setMasterId(long masterId) {
		this.masterId = masterId;
	}
	public String getLiveries() {
		liveries = StringProcesser.toString(liverySet, StringProcesser.SPLIT);
		return liveries;
	}
	public void setLiveries(String liveries) {
		this.liveries = liveries;
		liverySet = StringProcesser.toLongSet(liveries, StringProcesser.SPLIT);
	}
	public String getLosers() {
		losers = StringProcesser.toString(loserSet, StringProcesser.SPLIT);
		return losers;
	}
	public void setLosers(String losers) {
		this.losers = losers;
		loserSet = StringProcesser.toLongSet(losers, StringProcesser.SPLIT);
	}
	public String getRobEnemies() {
		robEnemies = StringProcesser.toString(robEnemySet, StringProcesser.SPLIT);
		return robEnemies;
	}
	public void setRobEnemies(String robEnemies) {
		this.robEnemies = robEnemies;
		robEnemySet = StringProcesser.toLongSet(robEnemies, StringProcesser.SPLIT);
	}
	public Set<Long> getLiverySet() {
		if(liverySet == null){
			liverySet = new LinkedHashSet<Long>();
		}
		return liverySet;
	}
	public Set<Long> getLoserSet() {
		if(loserSet == null){
			loserSet = new LinkedHashSet<Long>();
		}
		return loserSet;
	}
	public Set<Long> getRobEnemySet() {
		if(robEnemySet == null){
			robEnemySet = new LinkedHashSet<Long>();
		}
		return robEnemySet;
	}
	public void setLiverySet(Set<Long> liverySet) {
		this.liverySet = liverySet;
	}
	public void setLoserSet(Set<Long> loserSet) {
		this.loserSet = loserSet;
	}
	public void setRobEnemySet(Set<Long> robEnemySet) {
		this.robEnemySet = robEnemySet;
	}
	public int getLastRead() {
		return lastRead;
	}
	public void setLastRead(int lastRead) {
		this.lastRead = lastRead;
	}
}
